﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for GraphNumbers
/// </summary>
public class ConvertGraphData
{
  public ConvertGraphData()
	{
		//
		// TODO: Add constructor logic here
		//
	}

  public static Dictionary<string, string[]> Convert(DataTable dt)
  {
    Dictionary<string, string[]> graphData = new Dictionary<string, string[]>();
    for (int column = 0; column < dt.Columns.Count; column++)
    {
      string[] data = new string[dt.Rows.Count];
      string key = dt.Columns[column].ToString();
      
      for (int row = 0; row < dt.Rows.Count; row++)
        data[row] = dt.Rows[row][column].ToString();

      graphData.Add(key, data);
    }
    return graphData;
  }
}